package common

const (
	StatusOK = iota + 10000
	StatusFail
	StatusJSONFail
	StatusSQLFail
	StatusParamInvalid
	StatusTokenFail
	StatusServerError
	StatusRegisterFailed
	StatusLoginFailed
	StatusTokenInvalid
	StatusUserNotExists
)

var statusText = map[int]string{
	StatusOK:             "操作成功",
	StatusFail:           "操作失败",
	StatusJSONFail:       "json操作失败",
	StatusSQLFail:        "sql操作失败",
	StatusParamInvalid:   "请求参数无效",
	StatusTokenFail:      "token生成失败",
	StatusServerError:    "服务器错误",
	StatusRegisterFailed: "注册失败",
	StatusLoginFailed:    "登录失败",
	StatusTokenInvalid:   "token无效",
	StatusUserNotExists:  "用户不存在",
}

func StatusText(code int) string {
	return statusText[code]
}
